import {getBusinessStatistics} from "../../ajax/module/userInfo.js"
import imgUrl from "../../images/util.js"
var app = getApp();
Page({
  data: {
     dataInfo:{

     },
     logo:imgUrl.logoBase64,
     financeUrl:imgUrl.financeUrl,
     staffIcon:imgUrl.staffIcon,
     businessIcon:imgUrl.businessIcon

   
   
  },
  onShow(){
    console.log("globalData",app)
    app.globalData.newAddStaff={}
    getBusinessStatistics().then(res=>{
      console.log(res.data)
      let {totalOrderNum,
        totalTurnover,
        unitPrice,
        ytdTotalOrderNum,
        ytdTotalTurnover,
        ytdUnitPrice}=res.data

        this.setData({
          dataInfo:{totalOrderNum,
            totalTurnover,
            unitPrice,
            ytdTotalOrderNum,
            ytdTotalTurnover,
            ytdUnitPrice}
        })
    })

  },
  onLoad(){
  

  },
  jumpAccount(){
    wx.navigateTo({
      url: '../account-management/account-management',
    })
  },
  businessEdit(){
    // 跳转到商家资料

    
    wx.navigateTo({
      url: '../business-index/business-index',
    })
  },
  jumpRevenue(){
    // console.log("ccccc")
    wx.navigateTo({
      url: '../revenue-statistics/revenue-statistics',   
    })
  },
  jumpStaff(){
    wx.navigateTo({
      url: '../staff-management/staff-management',
    })
  },
  loginOut(){
    wx.clearStorage({
      success: (res) => {
        wx.reLaunch({
          url: '../index/index',
          
        });
      },
    })
   
  }
})